<template>
	<view class="wrapper-ana">
		<view class="fixed-border"></view>
		<ana-customer ref="customer" v-if="cusType == 3 || cusType == 2"></ana-customer>
		<ana-admin ref="admin" v-if="cusType == 0 || cusType == 1 "></ana-admin>
	</view>
</template>

<script>
	import anaCustomer from './customer.vue'
	import anaAdmin from './admin.vue'
	import {
	  mapState
	 } from 'vuex'
	export default {
		components: { 	
			anaAdmin,
		    anaCustomer
		},
		data() {
			return {
				cusType:0
			}
		},
		onPullDownRefresh() {
			if(this.$refs.admin){//管理员数据
				this.$refs.admin.getSales()
				this.$refs.admin.getTongbiData()
				this.$refs.admin.getKanBan()
			}else{
				this.$refs.customer.getSales()
			}
		},
		onReady() {
			this.cusType = this.$store.state.cusType
		},
		methods: {
			
		}
	}
</script>

<style lang="less">
.wrapper-ana{
	min-height: 100%;
	width: 100%;
	background-color: #FFFFFF;
}
</style>
